/*
day196
2020.3.11
*/
#include<string>
#include<vector>
#include<iostream>
using namespace std;

class Solution {
public:
    vector<string> readBinaryWatch(int num) {
    	vector<string> res;
		for(int i=0;i<=11;++i)
		{
			for(int j=0;j<=59;++j)
			{
				if(count(i)+count(j)==num)
				{
					string str_tem=to_string(i)+":"+(j<10 ? "0" : "")+to_string(j);
					res.push_back(str_tem);
				}
			}
		}
		return res;
    }
    
    int count(int n)
    {
    	int res=0;
    	while(n)
    	{
    		if(n%2==1)
    		{
    			res++;
			}
			n/=2;
		} 
		return res;
	}
};

int main()
{
	Solution s;
	vector<string> res=s.readBinaryWatch(0);
	for(auto &str:res)
	{
		cout<<str<<endl;
	}
	return 0;
}
